#ifndef CHATDATAPACK_H
#define CHATDATAPACK_H

#include <QByteArray>

class ChatDataPack {
public:
  ChatDataPack();
  ChatDataPack &operator<<(const QByteArray &);
  ChatDataPack &operator>>(QByteArray &out);

  static QByteArray pack(const QByteArray &data);

  operator bool() const;

private:
  static const QByteArray ChatterHeader;
  static const QByteArray ChatterTail;

  mutable QByteArray buf;
  mutable QByteArray data_buf;
};

#endif // CHATDATAPACK_H